// .vitepress/theme/index.ts
import type { Theme } from "vitepress";
import DefaultTheme from "vitepress/theme";

import "@z-ui/theme-chalk/src/icon.scss";
import "@z-ui/theme-chalk/src/tree.scss";

import ZIcon from "@z-ui/components/icon";
import ZTree from "@z-ui/components/tree";

const components = [ZIcon, ZTree];

export default {
  extends: DefaultTheme,
  enhanceApp({ app }) {
    // 注册自定义全局组件
    components.forEach((cpn) => {
      app.use(cpn);
    });
  },
} satisfies Theme;
